<?php
        $i = 1;
        $html   =   '';
        foreach($game_data AS $row){
            if($i == 1|| $i == 5){
                $html   .=  '<div class="list-game-row">';
                $html   .=  '<ul class="list-game-lastest">';
            }
            $link_url   =   "/choi-game/{$row['Game']['id']}-{$row['Game']['alias']}.html";
            $thumbnail  = Configure::read('game_flash_thumbnail_url_path'). $row['Game']['folder_url'] . $row['Game']['thumbnail'];
            $html   .=  '<li>';
            if($row['Game']['hot_icon']){
                $html   .=  '<p class="game-thumb"><img class="hot-icon" width="31px" height="32px" alt="Game hot" src="/img/icon-hot.png"><a href="' . $link_url . '" title="' . $row['Game']['title'] . '"><img src="' . $thumbnail . '" alt="' . $row['Game']['title'] . '" width="100px" height="80px" /></a></p>';
            }else{
                $html   .=  '<p class="game-thumb"><a href="' . $link_url . '" title="' . $row['Game']['title'] . '"><img src="' . $thumbnail . '" alt="' . $row['Game']['title'] . '" width="100px" height="80px" /></a></p>';
            }            $html   .=  '<p class="game-detail"> <strong><a href="' . $link_url . '" title="' . $row['Game']['title'] . '">' . $row['Game']['title'] . '</a></strong> <span>Đã chơi: ' . $row['Game']['play_times'] . '</span> </p>';
            $html   .=  '</li>';

            if($i == 8 || $i == 4 || $i == sizeof($game_data)){
                $html   .=  '</ul>';
                $html   .=  '</div>';
            }
            $i++;

        }
        $html   .=  '<p class="blockGame-viewmore"> <span><img src="/img/arrow-small-icon.gif" alt="xem thêm"></span> <span><img src="/img/arrow-small-icon.gif" alt="Xem thêm"></span> <a href="/danh-muc-game/nhieu-nguoi-choi-nhat/' . $row['Catgame']['id'] . '-' . $row['Catgame']['alias'] . '.html" title="Xem Thêm">Xem Thêm</a> </p>';
        echo $html;
?>